﻿@addTagHelper *, WebVella.Erp.Plugins.Core
@addTagHelper *, WebVella.Erp.Web
@addTagHelper *, WebVella.TagHelpers
@using WebVella.Erp.Web.Utils;
@using WebVella.Erp.Web.Components;
@using WebVella.Erp.Api.Models;
@using WebVella.Erp.Web;
@using WebVella.TagHelpers.Models;
@{
	var options = (PcSection.PcSectionOptions)ViewBag.Options;
	var erpRequest = (ErpRequestContext)ViewBag.RequestContext;
	var labelRenderModeOptions = (List<WvSelectOption>)ViewBag.LabelRenderModeOptions;
	var fieldRenderMode = (List<WvSelectOption>)ViewBag.FieldRenderModeOptions;
}

<wv-row>
	<wv-column span="4">
		<wv-field-datasource name="is_visible" label-text="Is Rendered" value="@options.IsVisible" page-id="erpRequest.Page.Id" placeholder="true"></wv-field-datasource>
	</wv-column>
	<wv-column span="4">
		<wv-field-datasource name="title" label-text="Title" value="@options.Title" page-id="erpRequest.Page.Id"></wv-field-datasource>
	</wv-column>
	<wv-column span="4">
		<wv-field-text name="title_tag" label-text="Title tag" value="@options.TitleTag" placeholder="h3"></wv-field-text>
	</wv-column>
</wv-row>
<wv-row>
	<wv-column span="4">
		<wv-field-checkbox name="is_card" label-text="Is Card" value="@options.IsCard" text-true="render as card"></wv-field-checkbox>
	</wv-column>
	<wv-column span="4">
		<wv-field-checkbox name="is_collapsable" label-text="Is Collapsable" value="@options.IsCollapsable" text-true="render as collapsable"></wv-field-checkbox>
	</wv-column>
	<wv-column span="4">
        <wv-field-datasource name="is_collapsed_ds" label-text="Is Initially Collapsed" value="@options.IsCollapsedDs" page-id="erpRequest.Page.Id" description="Leave empty to toggle based on last user action"></wv-field-datasource>
		@*<wv-field-checkbox name="is_collapsed" label-text="Is Collapsed" value="@options.IsCollapsed" text-true="initially collapsed"></wv-field-checkbox>*@
	</wv-column>
</wv-row>
<wv-row>
	<wv-column span="4">
		<wv-field-text name="class" label-text="Class" value="@options.Class"></wv-field-text>
	</wv-column>
	<wv-column span="4">
		<wv-field-text name="body_class" label-text="Body Class" value="@options.BodyClass"></wv-field-text>
	</wv-column>
</wv-row>
<wv-row>
	<wv-column span="4">
		<wv-field-select name="label_mode" label-text="Label mode" value="@options.LabelMode" options="labelRenderModeOptions" description="can be inherited by any inserted fields" required="true"></wv-field-select>
	</wv-column>
	<wv-column span="4">
		<wv-field-select name="field_mode" label-text="Field mode" value="@options.FieldMode" options="fieldRenderMode" description="can be inherited by any inserted fields" required="true"></wv-field-select>
	</wv-column>
</wv-row>
